Skip to content

Conversation

@ATimmeh33
Copy link
Collaborator

@ATimmeh33 ATimmeh33 commented Nov 27, 2025

This pull request introduces a new integration test project for the Signhost API client, adds comprehensive integration tests that require live credentials, and extends support for new verification types in the data model. It also includes minor improvements and clarifications in the codebase and CI/CD configuration.

Integration Testing Infrastructure:

  • Added a new project SignhostAPIClient.IntegrationTests with configuration for .NET 8, user secrets, and necessary dependencies. This project is now included in the solution file and is excluded from packaging and CI/CD runs. [1] [2] [3] [4] [5]
  • Implemented a robust integration test (TransactionTests.cs) that exercises transaction creation, file upload, and transaction state verification, ensuring real-world API functionality.
  • Provided a README.md with clear instructions for configuring and running integration tests safely with user secrets.
  • Added a TestConfiguration class that loads credentials only from user secrets to prevent accidental credential leaks.

Verification and Authentication Model Extensions:

  • Added support for new verification types: CscVerification, EherkenningVerification, OidcVerification, and OnfidoVerification, expanding the range of supported identity and signature verification methods. [1] [2] [3] [4]
  • Updated PhoneNumberVerification and DigidVerification to include a SecureDownload property. [1] [2]
  • Added comments and TODOs for future improvements in the verification model, such as splitting authentication and verification interfaces.

Data Model and Serialization Improvements:

  • Enhanced the Activity class with a new ActivityValue property and JSON serialization attributes. [1] [2]
  • Added TODO comments in ActivityType and Field classes for future refactoring. [1] [2]

Error Handling and Miscellaneous:

  • Improved error handling by capturing and exposing the response body for all Signhost API exceptions.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the SignhostAPIClient for a v5 major release by adding new API features, improving error handling, and establishing integration tests. The changes include new verification types (Onfido, OIDC, eHerkenning, CSC), enhanced data models with additional properties, and a new ResponseBody property for exception handling.

Key changes:

  • Added new verification types (OnfidoVerification, OidcVerification, EherkenningVerification, CscVerification) to support additional authentication methods
  • Enhanced exception handling by adding ResponseBody property to SignhostRestApiClientException and refactoring error handling logic
  • Created integration test infrastructure with user secrets configuration to test against live API

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SignhostRestApiClientException.cs Added ResponseBody property to expose API error details
SignhostException.cs Added TODO comment for v5 removal
HttpResponseMessageErrorHandlingExtensions.cs Refactored exception throwing to use switch-and-assign pattern; added ResponseBody population
BadAuthorizationException.cs Added TODO comment for v5 usage
SurfnetVerification.cs Added Uid and Attributes properties
Signer.cs Added timestamp and URL properties for signer lifecycle tracking
Receiver.cs Added Id and timestamp properties
PhoneNumberVerification.cs Added SecureDownload property
OnfidoVerification.cs New verification type for Onfido identity verification
OidcVerification.cs New verification type for OpenID Connect
IVerification.cs Added TODO comment for v5 interface split
Field.cs Added TODO comments for type improvements in v5
EherkenningVerification.cs New verification type for eHerkenning authentication
DigidVerification.cs Added SecureDownload property
CscVerification.cs New verification type for Cloud Signature Consortium
ActivityType.cs Added TODO comment for cleanup in v5
Activity.cs Added ActivityValue property with JSON mapping
ApiResponse.cs Added ResponseBody to GoneException with async workaround
SignhostAPIClient.sln Added integration tests project reference
TransactionTests.cs New comprehensive integration test for transaction lifecycle
TestConfiguration.cs Configuration loader for integration test credentials
SignhostAPIClient.IntegrationTests.csproj Project file for integration tests
README.md Documentation for integration test setup
publish_nuget_package.yml Added comment about integration tests exclusion

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

break;

case HttpStatusCode.PaymentRequired
when errorType == "https://api.signhost.com/problem/subscription/out-of-credits":
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded URL string should use the OutOfCreditsApiProblemType constant defined on line 15 instead of duplicating the value.

Suggested change
when errorType == "https://api.signhost.com/problem/subscription/out-of-credits":
when errorType == OutOfCreditsApiProblemType:

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@ATimmeh33 ATimmeh33 mentioned this pull request Nov 27, 2025
/// <summary>
/// Gets or sets the certificate issuer.
/// </summary>
public string Issuer { get; set; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did you get this def, for api the Provider only exposed and not Issuer, Subject, Thumbprint, AdditionalUserData they come from the settings as far as I remember.

Copy link
Collaborator Author

@ATimmeh33 ATimmeh33 Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do expose them already, these are all returned in the postback/GETs after successful CSC verification

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that CscVerification class is only for creation of the transaction and not about postabcks or other gets, otherwise like OIDCVerification also would expose something else. Sync with Berend too on this, seems strange if this class is only for the TranactionCreation purpose by Client to also include other attributes of the response.

Copy link
Contributor

@BerendJonkman BerendJonkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved tech & style - 6f004ef29150bfab2e7e96ea8393caf06ef9b51b

@ATimmeh33 ATimmeh33 merged commit 948cbb9 into master Dec 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants